home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Presentations / Presentations ’96 / Sessions ’96 / ODF- Easy OpenDoc / MacHack(5) / Sources / Views.fr < prev   
Encoding:
Text File  |  1996-06-17  |  3.6 KB  |  122 lines  |  [TEXT/CWIE]

  1. //========================================================================================
  2. //
  3. //    File:                Views.fr
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Contains:            Common (Platform independent) resources for the MacHack part
  7. //
  8. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef FWRESFIL_K
  13. #include "FWResFil.k"
  14. #endif
  15.  
  16. #ifndef FWVIEWS_FR
  17. #include "FWViews.fr"
  18. #endif
  19.  
  20. #ifndef FWNOTDEF_H
  21. #include "FWNotDef.h"     
  22. #endif
  23.  
  24. #ifndef DEFINES_K
  25. #include "Defines.k"
  26. #endif
  27.  
  28. //========================================================================================
  29. // type RMacHackView
  30. //========================================================================================
  31. // RMacHackView doesn't add any field to FW_RSuperView
  32. // IMPORTANT: the resource label below must match LMacHackView declared in the .cpp file 
  33.  
  34. type RMacHackView : FW_RSuperView(Label='mhvw')
  35. {
  36. };
  37.  
  38. //========================================================================================
  39. // resource RDrawFrame(kDrawView)
  40. //========================================================================================
  41. // See constants in "FWViews.k", macros & resource types in "FWViews.fr"
  42.  
  43. // Reference size for the Draw frame (will be adjusted at runtime)
  44. #define H     FW_FIX(1000)
  45. #define H1     H + FW_FIX(1)
  46.  
  47. // Drawing extent (constants defined in Defines.k to be used also in .cpp files)
  48. #define X    FW_FIX(kDrawingSizeX)
  49. #define Y    FW_FIX(kDrawingSizeY)
  50.  
  51. resource FW_RFrameLayout(kMacHackView)
  52. {
  53.     {H,H},                    // LayoutSize
  54.     {                        // Start list of frame's subviews
  55.         RMacHackView
  56.         (
  57.             kMacHackViewID,                    // View id
  58.             {0, 0, H-FW_SBSIZE, H-FW_SBSIZE},    // Bounds
  59.             FW_kFitToEnclosure,                    // bindings
  60.             {X,Y},                                // extent
  61.             1,                                    // Make it the ContentView
  62.             FW_kXYScrolling,                    // scrolling in both directions
  63.             {
  64.                 FW_RButton
  65.                 (
  66.                     kNextID,                        // view id
  67.                     { FW_FIX(160),FW_FIX(170),FW_FIX(220),FW_FIX(190)},
  68.                     FW_kFixedBounds,                // binding
  69.                     FW_kButtonPressedMsg,            // control message
  70.                     FW_kViewReceiver,                // receiver
  71.                     0,                                // control value
  72.                     FW_kPushButton,                    // button kind
  73.                     FW_SYSTEM_FONT,
  74.                     "Next"            
  75.                 )
  76.             }
  77.         ),
  78.         FW_RScrollBar            // Horizontal SB
  79.         (
  80.             kHorzScrollBarID,                    // View id
  81.             {-FW_ONE, H-FW_SBSIZE, H1-FW_SBSIZE, H1},// Bounds
  82.             FW_kHScrollBarBinding,                // Standard horizontal SB bindings
  83.             0,                                    // control message
  84.             0,                                    // control receiver
  85.             0,                                    // control value
  86.             0,                                    // SB Min Value (adjusted at runtime)
  87.             1,                                    // SB Max Value (adjusted at runtime)
  88.             FW_ONE,                                // SB Minor Units (adjusted at runtime)
  89.             FW_ONE                                // SB Major Units (adjusted at runtime)
  90.         ),
  91.         FW_RScrollBar            // Vertical SB
  92.         (
  93.             kVertScrollBarID,                    // View id
  94.             {H-FW_SBSIZE,-FW_ONE, H1, H1-FW_SBSIZE},// Bounds
  95.             FW_kVScrollBarBinding,                // Standard vertical SB binding
  96.             0,                                    // control message
  97.             0,                                    // control receiver
  98.             0,                                    // control value
  99.             0,                                    // SB Min Value (adjusted at runtime)
  100.             1,                                    // SB Max Value (adjusted at runtime)
  101.             FW_ONE,                                // SB Minor Units (adjusted at runtime)
  102.             FW_ONE                                // SB Major Units (adjusted at runtime)
  103.         ),
  104.         FW_RGrowBox
  105.         (
  106.             kGrowBoxID,                            // View id
  107.             {H - FW_SBSIZE, H - FW_SBSIZE, H1, H1},    // Bounds
  108.             FW_kGrowBoxBinding                    // standard grow box binding
  109.         )
  110.     },
  111.     {                            // Scroller
  112.         FW_RScrollBarScroller
  113.         (
  114.             FW_FIX(15),                            // AutoScrollInset
  115.             {FW_FIX(20), FW_FIX(20)}            // AutoScrollIncrement
  116.             kHorzScrollBarID,                    // horiz sb id
  117.             kVertScrollBarID                    // vertical sb id
  118.         )
  119.     }
  120. };
  121.  
  122.